Imputation
source("imputation.R", local = knitr::knit_global())
## reg age sex hgt wgt
## 991 996 1014 1014 990
MICE: Wight
MICE:compare the imputed datasets with orignal dataset
df_mice_wgt <- create_compare_data(data,miss_data,impt_mice_data,col = "wgt",method = "mice",sp_impt="method")
ggplot(df_mice_wgt, aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_mice_wgt, aes(source,wgt, colour = source))+geom_boxplot()

ggplot(df_mice_wgt, aes(source,wgt, colour = source))+geom_boxplot(aes(colour=sex))

ggplot(df_mice_wgt, aes(as.integer(age),wgt, colour = source))+geom_boxplot()

MICE:compare split with Sex
df_mice_wgt <- create_compare_data(data,miss_data,impt_mice_data,col = "wgt",method = "mice",sp_impt="sex")
ggplot(df_mice_wgt, aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_mice_wgt, aes(source,wgt, colour = source))+geom_boxplot()

MICE:compare by NA counts
ggplot(df_mice_wgt, aes(age,wgt, colour = na_count))+geom_point(alpha=0.4)+stat_smooth()

MICE:compare split with age 14
# age above 14
ggplot(df_mice_wgt[df_mice_wgt$age >= 14,], aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

# age below 14
ggplot(df_mice_wgt[df_mice_wgt$age <14,], aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

Ranger: Wight
Ranger:compare the imputed datasets with orignal dataset
df_ranger_wgt <- create_compare_data(data,miss_data,impt_ranger_data,col = "wgt",method = "ranger",sp_impt="method")
ggplot(df_ranger_wgt, aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_ranger_wgt, aes(source,wgt, colour = source))+geom_boxplot()

ggplot(df_ranger_wgt, aes(source,wgt, colour = source))+geom_boxplot(aes(colour=sex))

Ranger:compare split with Sex
df_ranger_wgt <- create_compare_data(data,miss_data,impt_ranger_data,col = "wgt",method = "ranger",sp_impt="sex")
ggplot(df_ranger_wgt, aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_ranger_wgt, aes(source,wgt, colour = source))+geom_boxplot()

Ranger:compare by NA counts
ggplot(df_ranger_wgt, aes(age,wgt, colour = na_count))+geom_point(alpha=0.4)+stat_smooth()
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

Ranger:compare split with age 14
# age above 14
ggplot(df_ranger_wgt[df_ranger_wgt$age >= 14,], aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

# age below 14
ggplot(df_ranger_wgt[df_ranger_wgt$age <14,], aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

MIDAS: Wight
MIDAS:compare the imputed datasets with orignal dataset
df_midas_wgt <- create_compare_data(data,miss_data,impt_rmidas_data,col = "wgt",method = "midas",sp_impt="method")
ggplot(df_midas_wgt, aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_midas_wgt, aes(source,wgt, colour = source))+geom_boxplot()

ggplot(df_midas_wgt, aes(source,wgt, colour = source))+geom_boxplot(aes(colour=sex))

MIDAS:compare split with Sex
df_midas_wgt <- create_compare_data(data,miss_data,impt_rmidas_data,col = "wgt",method = "midas",sp_impt="sex")
ggplot(df_midas_wgt, aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_midas_wgt, aes(source,wgt, colour = source))+geom_boxplot()

MIDAS:compare by NA counts
ggplot(df_midas_wgt, aes(age,wgt, colour = na_count))+geom_point(alpha=0.4)+stat_smooth()

MIDAS:compare split with age 14
# age above 14
ggplot(df_midas_wgt[df_midas_wgt$age >= 14,], aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

# age below 14
ggplot(df_midas_wgt[df_midas_wgt$age <14,], aes(age,wgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

MICE: Hight
MICE:compare the imputed datasets with orignal dataset
df_mice_hgt <- create_compare_data(data,miss_data,impt_mice_data,col = "hgt",method = "mice",sp_impt="method")
ggplot(df_mice_hgt, aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_mice_hgt, aes(source,hgt, colour = source))+geom_boxplot()

ggplot(df_mice_hgt, aes(source,hgt, colour = source))+geom_boxplot(aes(colour=sex))

MICE:compare split with Sex
df_mice_hgt <- create_compare_data(data,miss_data,impt_mice_data,col = "hgt",method = "mice",sp_impt="sex")
ggplot(df_mice_hgt, aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_mice_hgt, aes(source,hgt, colour = source))+geom_boxplot()

MICE:compare by NA counts
ggplot(df_mice_hgt, aes(age,hgt, colour = na_count))+geom_point(alpha=0.4)+stat_smooth()

MICE:compare split with age 14
# age above 14
ggplot(df_mice_hgt[df_mice_hgt$age >= 14,], aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

# age below 14
ggplot(df_mice_hgt[df_mice_hgt$age <14,], aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

Ranger: Hight
Ranger:compare the imputed datasets with orignal dataset
df_ranger_hgt <- create_compare_data(data,miss_data,impt_ranger_data,col = "hgt",method = "ranger",sp_impt="method")
ggplot(df_ranger_hgt, aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_ranger_hgt, aes(source,hgt, colour = source))+geom_boxplot()

ggplot(df_ranger_hgt, aes(source,hgt, colour = source))+geom_boxplot(aes(colour=sex))

Ranger:compare split with Sex
df_ranger_hgt <- create_compare_data(data,miss_data,impt_ranger_data,col = "hgt",method = "ranger",sp_impt="sex")
ggplot(df_ranger_hgt, aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_ranger_hgt, aes(source,hgt, colour = source))+geom_boxplot()

Ranger:compare by NA counts
ggplot(df_ranger_hgt, aes(age,hgt, colour = na_count))+geom_point(alpha=0.4)+stat_smooth()

Ranger:compare split with age 14
# age above 14
ggplot(df_ranger_hgt[df_ranger_hgt$age >= 14,], aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

# age below 14
ggplot(df_ranger_hgt[df_ranger_hgt$age <14,], aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

MIDAS: Hight
MIDAS:compare the imputed datasets with orignal dataset
df_midas_hgt <- create_compare_data(data,miss_data,impt_rmidas_data,col = "hgt",method = "midas",sp_impt="method")
ggplot(df_midas_hgt, aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_midas_hgt, aes(source,hgt, colour = source))+geom_boxplot()

ggplot(df_midas_hgt, aes(source,hgt, colour = source))+geom_boxplot(aes(colour=sex))

MIDAS:compare split with Sex
df_midas_hgt <- create_compare_data(data,miss_data,impt_rmidas_data,col = "hgt",method = "midas",sp_impt="sex")
ggplot(df_midas_hgt, aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

ggplot(df_midas_hgt, aes(source,hgt, colour = source))+geom_boxplot()

ggplot(df_midas_hgt, aes(as.integer(age),hgt, colour = source))+geom_boxplot()

MIDAS:compare by NA counts
ggplot(df_midas_hgt, aes(age,hgt, colour = na_count))+geom_point(alpha=0.4)+stat_smooth()

MIDAS:compare split with age 14
# age above 14
ggplot(df_midas_hgt[df_midas_hgt$age >= 14,], aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()

# age below 14
ggplot(df_midas_hgt[df_midas_hgt$age <14,], aes(age,hgt, colour = source))+geom_point(alpha=0.4)+stat_smooth()
